package com.ruoyi.project.gzbook.orderinfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.gzbook.orderinfo.mapper.DgOrderInfoMapper;
import com.ruoyi.project.gzbook.orderinfo.domain.DgOrderInfo;
import com.ruoyi.project.gzbook.orderinfo.service.IDgOrderInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 订单信息Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-06
 */
@Service
public class DgOrderInfoServiceImpl implements IDgOrderInfoService 
{
    @Autowired
    private DgOrderInfoMapper dgOrderInfoMapper;

    /**
     * 查询订单信息
     * 
     * @param id 订单信息主键
     * @return 订单信息
     */
    @Override
    public DgOrderInfo selectDgOrderInfoById(Long id)
    {
        return dgOrderInfoMapper.selectDgOrderInfoById(id);
    }

    /**
     * 查询订单信息列表
     * 
     * @param dgOrderInfo 订单信息
     * @return 订单信息
     */
    @Override
    public List<DgOrderInfo> selectDgOrderInfoList(DgOrderInfo dgOrderInfo)
    {
        return dgOrderInfoMapper.selectDgOrderInfoList(dgOrderInfo);
    }

    /**
     * 新增订单信息
     * 
     * @param dgOrderInfo 订单信息
     * @return 结果
     */
    @Override
    public int insertDgOrderInfo(DgOrderInfo dgOrderInfo)
    {
        dgOrderInfo.setCreateTime(DateUtils.getNowDate());
        return dgOrderInfoMapper.insertDgOrderInfo(dgOrderInfo);
    }

    /**
     * 修改订单信息
     * 
     * @param dgOrderInfo 订单信息
     * @return 结果
     */
    @Override
    public int updateDgOrderInfo(DgOrderInfo dgOrderInfo)
    {
        return dgOrderInfoMapper.updateDgOrderInfo(dgOrderInfo);
    }

    /**
     * 批量删除订单信息
     * 
     * @param ids 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDgOrderInfoByIds(String ids)
    {
        return dgOrderInfoMapper.deleteDgOrderInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单信息信息
     * 
     * @param id 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDgOrderInfoById(Long id)
    {
        return dgOrderInfoMapper.deleteDgOrderInfoById(id);
    }
}
